#include "aeampspectrum.h"
#include "private/aespectrumprivatedefine.h"
#include "common/dataspecificationutils.h"
#include "common/binaryprocesshelper.h"
#include "common/xmldocument.h"
#include "private/spectrumdatafilecommondefine.h"
#include "common/xmlprocesshelper.h"
#include <QDebug>

namespace DataSpecificationGW
{
    class AEAmpSpectrumPrivate
    {
    public:
        AEAmpExtInformationPrivate m_stAEAmpExtInformationPrivate;
        AEAmpDataPrivate m_stAEAmpDataPrivate;
    };

    AEAmpSpectrum::AEAmpSpectrum()
        : Spectrum(),
          m_pAEAmpSpectrumPrivate(new AEAmpSpectrumPrivate)
    {
        setSpectrumTypeCode(SPECTRUM_CODE_AE_AMP);
    }

    AEAmpSpectrum::~AEAmpSpectrum()
    {
    }

    /************************************************
     * 函数名   : setDataSpecificationVersion
     * 输入参数 :
       const DataSpecificationVersion eDataSpecificationVersion: 数据规范版本号
     * 输出参数 : NULL
     * 返回值   : void
     * 功能     : 设置数据规范版本号
     ************************************************/
    void AEAmpSpectrum::setDataSpecificationVersion(const DataSpecificationVersion eDataSpecificationVersion)
    {
        Spectrum::setDataSpecificationVersion(eDataSpecificationVersion);
        if (V_1_1_0_0 == eDataSpecificationVersion)
        {
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipTriggerThreshold();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipOpenTime();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipShutTime();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipMaxIntervalTime();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipGain();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipSyncSource();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipSyncState();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipSyncFrequency();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipDischargeSeverity();

            m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.skipBGSignalMax();
            m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.skipBGSignalRMS();
            m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.skipBGFrequencyComponent1();
            m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.skipBGFrequencyComponent2();
        }
        else if (V_4_1_0_2 == eDataSpecificationVersion)
        {
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipFrequencyBand();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipFrequencyLowerLimit();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipFequencyUpperLimit();
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.skipBGFileName();
        }
    }

    /************************************************
     * 函数名   : spectrumName
     * 输入参数 : NULL
     * 输出参数 : NULL
     * 返回值   : QString
     * 功能     : 图谱名称
     ************************************************/
    QString AEAmpSpectrum::spectrumName() const
    {
        return STR_FILE_NODE_AE_AMP;
    }

    /************************************************
     * 函数名   : setAEAmpExtInformation
     * 输入参数 :
       const AEAmpExtInformation& stAEAmpExtInformation: AE幅值ExtInformation
     * 输出参数 : NULL
     * 返回值   : void
     * 功能     : 设置AE幅值ExtInformation
     ************************************************/
    void AEAmpSpectrum::setAEAmpExtInformation(const AEAmpExtInformation& stAEAmpExtInformation)
    {
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit = stAEAmpExtInformation.eAmpUnit;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit = stAEAmpExtInformation.fAmpLowerLimit;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit = stAEAmpExtInformation.fAmpUpperLimit;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType = stAEAmpExtInformation.eAESensorType;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint = stAEAmpExtInformation.iDataPoint;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency = stAEAmpExtInformation.fSystemFrequency;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability.reserve(8);

        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability.clear();
        for (const quint8& ucDischargeTypeProb : stAEAmpExtInformation.aucPDTypeProbability)
        {
            m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability.push_back(ucDischargeTypeProb);
        }

        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand = stAEAmpExtInformation.eFrequencyBand;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit = stAEAmpExtInformation.fFrequencyLowerLimit;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit = stAEAmpExtInformation.fFequencyUpperLimit;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName = stAEAmpExtInformation.qstrBGFileName;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold = stAEAmpExtInformation.fTriggerThreshold;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime = stAEAmpExtInformation.sOpenTime;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime = stAEAmpExtInformation.sShutTime;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime = stAEAmpExtInformation.sMaxIntervalTime;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain = stAEAmpExtInformation.sGain;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource = stAEAmpExtInformation.eSyncSource;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState = stAEAmpExtInformation.ucSyncState;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency = stAEAmpExtInformation.fSyncFrequency;
        m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity = stAEAmpExtInformation.eDischargeSeverity;
    }

    /************************************************
     * 函数名   : setAEAmpData
     * 输入参数 :
       const AEAmpData& stAEAmpData: AE幅值Data
     * 输出参数 : NULL
     * 返回值   : void
     * 功能     : 设置AE幅值Data
     ************************************************/
    void AEAmpSpectrum::setAEAmpData(const AEAmpData& stAEAmpData)
    {
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax = stAEAmpData.fSignalMax;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS = stAEAmpData.fSignalRMS;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1 = stAEAmpData.fFrequencyComponent1;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2 = stAEAmpData.fFrequencyComponent2;

        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax = stAEAmpData.fBGSignalMax;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS = stAEAmpData.fBGSignalRMS;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1 = stAEAmpData.fBGFrequencyComponent1;
        m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2 = stAEAmpData.fBGFrequencyComponent2;
    }

    /************************************************
     * 函数名   : getAEAmpExtInformation
     * 输入参数 : NULL
     * 输出参数 :
       AEAmpExtInformation& stAEAmpExtInformation: AE幅值ExtInformation
     * 返回值   : void
     * 功能     : 获取AE幅值ExtInformation
     ************************************************/
    void AEAmpSpectrum::getAEAmpExtInformation(AEAmpExtInformation &stAEAmpExtInformation)
    {
        stAEAmpExtInformation.eAmpUnit = static_cast<AmpUnit>(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit);
        stAEAmpExtInformation.fAmpLowerLimit = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit;
        stAEAmpExtInformation.fAmpUpperLimit = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit;
        stAEAmpExtInformation.eAESensorType = static_cast<AESensorType>(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType);
        stAEAmpExtInformation.iDataPoint = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint;
        stAEAmpExtInformation.fSystemFrequency = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency;

        std::copy(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability.begin(), m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability.end(), stAEAmpExtInformation.aucPDTypeProbability);

        stAEAmpExtInformation.eFrequencyBand = static_cast<FrequencyBand>(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand);
        stAEAmpExtInformation.fFrequencyLowerLimit = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit;
        stAEAmpExtInformation.fFequencyUpperLimit = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit;
        stAEAmpExtInformation.qstrBGFileName = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName;
        stAEAmpExtInformation.fTriggerThreshold = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold;
        stAEAmpExtInformation.sOpenTime = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime;
        stAEAmpExtInformation.sShutTime = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime;
        stAEAmpExtInformation.sMaxIntervalTime = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime;
        stAEAmpExtInformation.sGain = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain;
        stAEAmpExtInformation.eSyncSource = static_cast<SyncSource>(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource);
        stAEAmpExtInformation.ucSyncState = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState;
        stAEAmpExtInformation.fSyncFrequency = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency;
        stAEAmpExtInformation.eDischargeSeverity = static_cast<DischargeSeverity>(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity);
    }

    /************************************************
     * 函数名   : setAEAmpData
     * 输入参数 : NULL
     * 输出参数 :
       AEAmpData& stAEAmpData: AE幅值Data
     * 返回值   : void
     * 功能     : 获取AE幅值Data
     ************************************************/
    void AEAmpSpectrum::getAEAmpData(AEAmpData& stAEAmpData)
    {
        stAEAmpData.fSignalMax = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax;
        stAEAmpData.fSignalRMS = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS;
        stAEAmpData.fFrequencyComponent1 = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1;
        stAEAmpData.fFrequencyComponent2 = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2;

        stAEAmpData.fBGSignalMax = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax;
        stAEAmpData.fBGSignalRMS = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS;
        stAEAmpData.fBGFrequencyComponent1 = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1;
        stAEAmpData.fBGFrequencyComponent2 = m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2;
    }

    /************************************************
     * 函数名   : saveBinarySpectrumExtInfo
     * 输入参数 :
       QDataStream& out: 输出流
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存二进制可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::saveBinarySpectrumExtInfo(QDataStream& out)
    {
        out.device()->seek(SPECTRUM_HEADER_LENGTH);
        //幅值单位
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUnit)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit;
        //幅值下限
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpLowerLimit)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit;
        //幅值上限
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUpperLimit)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit;
        //超声波传感器类型
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAESensorType)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType;
        //数据点数n
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDataPoint)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint;
        //试验频率
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSystemFrequency)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency;
        //放电类型概率
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipPDTypeProbability)
        {
            for (const quint8& uPDType : m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability)
            {
                out << uPDType;
            }
        }
        //信号最大值 信号有效值 50Hz相关性 100Hz相关性
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDataPoint)
        {
            //将数据部分进行填充，占位
            for (int i = 0; i < m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint; ++i)
            {
                out << (float)0;
            }
        }
        //频带
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyBand)
            out << (quint8)m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand;
        //下限频率
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyLowerLimit)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit;
        //上限频率
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFequencyUpperLimit)
            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit;
        //背景文件名称
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipBGFileName)
            DataSpecificationUtils::convertStringToBinary(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName, TYPE_ASCII, out, BG_FILE_NAME_LENTH);

//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipTriggerThreshold)
//            //out <<(float)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipOpenTime)
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipShutTime)
//            //out << (qint16)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipMaxIntervalTime)
//            //out << (qint16)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipGain)
//            //out << (qint16)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncSource)
//            //out << (quint8)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncState)
//            //out << (quint8)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncFrequency)
//            //out <<(float)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency;
//        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDischargeSeverity)
//            //out << (quint8)0;
//            out << m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity;

        DataSpecificationUtils::saveBinaryReservedData(SPECTRUM_BASE_LENGTH - out.device()->size(), out);
        qDebug()<<">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Data Stream Size:"<<out.device()->size();
        return true;
    }

    /************************************************
     * 函数名   : saveXMLSpectrumExtInfo
     * 输入参数 :
       XMLDocument& xmlDocumentObj: xml文档对象
       QDomElement& element: dom元素
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存XML可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::saveXMLSpectrumExtInfo(XMLDocument& xmlDocumentObj, QDomElement& element)
    {
        xmlDocumentObj.beginElement(element);
        xmlDocumentObj.beginElement(STR_SPECTRUM_NODE_EXTINFORMATION);

        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUnit) xmlDocumentObj.setValue(TEXT_AMP_UNIT, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpLowerLimit) xmlDocumentObj.setValue(TEXT_AMP_MIN, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUpperLimit) xmlDocumentObj.setValue(TEXT_AMP_MAX, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAESensorType) xmlDocumentObj.setValue(TEXT_SENSOR_TYPE, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDataPoint) xmlDocumentObj.setValue(TEXT_DATA_POINT, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSystemFrequency) xmlDocumentObj.setValue(TEXT_SYSTEM_FREQUENCY, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipPDTypeProbability) xmlDocumentObj.setValue(TEXT_PD_TYPE_PR, DataSpecificationUtils::dischargeTypeProbabilityVector2QString(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyBand) xmlDocumentObj.setValue(TEXT_BAND_WIDTH, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyLowerLimit) xmlDocumentObj.setValue(TEXT_FRQ_MIN, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFequencyUpperLimit) xmlDocumentObj.setValue(TEXT_FRQ_MAX, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipBGFileName) xmlDocumentObj.setValue(TEXT_BG_FILE_NAME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipTriggerThreshold) xmlDocumentObj.setValue(TEXT_TRIGGER_THRESHOLD, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipOpenTime) xmlDocumentObj.setValue(TEXT_OPEN_TIME, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipShutTime) xmlDocumentObj.setValue(TEXT_SHUT_TIME, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipMaxIntervalTime) xmlDocumentObj.setValue(TEXT_MAX_TIME_INTERVAL, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipGain) xmlDocumentObj.setValue(TEXT_GAIN, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncSource) xmlDocumentObj.setValue(TEXT_SYNC_SOURCE, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncState) xmlDocumentObj.setValue(TEXT_SYNC_STATE, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncFrequency) xmlDocumentObj.setValue(TEXT_SYNC_FREQ, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDischargeSeverity) xmlDocumentObj.setValue(TEXT_DISCHARGE_SEVERITY, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity));

        return true;
    }

    /************************************************
     * 函数名   : saveJSONSpectrumExtInfo
     * 输入参数 :
       rapidjson::Document::AllocatorType& alloc:
       rapidjson::Value& jsonValue: json数据
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存JSON可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::saveJSONSpectrumExtInfo(rapidjson::Document::AllocatorType& alloc, rapidjson::Value& jsonValue)
    {
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUnit) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit, TEXT_AMP_UNIT, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpLowerLimit) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit, TEXT_AMP_MIN, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUpperLimit) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit, TEXT_AMP_MAX, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAESensorType) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType, TEXT_SENSOR_TYPE, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDataPoint) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint, TEXT_DATA_POINT, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSystemFrequency) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency, TEXT_SYSTEM_FREQUENCY, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipPDTypeProbability) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability, TEXT_PD_TYPE_PR, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyBand) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand, TEXT_BAND_WIDTH, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyLowerLimit) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit, TEXT_FRQ_MIN, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFequencyUpperLimit) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit, TEXT_FRQ_MAX, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipBGFileName) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName, TEXT_BG_FILE_NAME, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipTriggerThreshold) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold, TEXT_TRIGGER_THRESHOLD, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipOpenTime) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime, TEXT_OPEN_TIME, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipShutTime) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime, TEXT_SHUT_TIME, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipMaxIntervalTime) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime, TEXT_MAX_TIME_INTERVAL, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipGain) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain, TEXT_GAIN, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncSource) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource, TEXT_SYNC_SOURCE, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncState) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState, TEXT_SYNC_STATE, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncFrequency) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency, TEXT_SYNC_FREQ, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDischargeSeverity) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity, TEXT_DISCHARGE_SEVERITY, alloc, jsonValue);

        return true;
    }

    /************************************************
     * 函数名   : saveBinarySpectrumData
     * 输入参数 :
       QDataStream& out: 输出流
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存二进制图谱数据段
     ************************************************/
    bool AEAmpSpectrum::saveBinarySpectrumData(QDataStream& out)
    {
        if (m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint <= 0)
        {
            return false;
        }
        out.device()->seek(AE_AMP_DATA_START_POS);

        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSignalMax) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipSignalRMS) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent1) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent2) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalMax) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalRMS) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent1) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1;
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent2) out << m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2;

        return true;
    }

    /************************************************
     * 函数名   : saveXMLSpectrumData
     * 输入参数 :
       XMLDocument& xmlDocumentObj: xml文档对象
       QDomElement& element: dom元素
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存XML图谱数据段
     ************************************************/
    bool AEAmpSpectrum::saveXMLSpectrumData(XMLDocument& xmlDocumentObj, QDomElement& element)
    {
        xmlDocumentObj.beginElement(element);
        xmlDocumentObj.beginElement(STR_SPECTRUM_NODE_DATA);

        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSignalMax) xmlDocumentObj.setValue(TEXT_PEAK, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipSignalRMS) xmlDocumentObj.setValue(TEXT_RMS, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent1) xmlDocumentObj.setValue(TEXT_FREQUENCY1, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent2) xmlDocumentObj.setValue(TEXT_FREQUENCY2, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalMax) xmlDocumentObj.setValue(TEXT_PEAK_BG, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalRMS) xmlDocumentObj.setValue(TEXT_RMS_BG, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent1) xmlDocumentObj.setValue(TEXT_FREQUENCY1_BG, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1, 'f', 1));
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent2) xmlDocumentObj.setValue(TEXT_FREQUENCY2_BG, QString::number(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2, 'f', 1));

        return true;
    }

    /************************************************
     * 函数名   : saveJSONSpectrumData
     * 输入参数 :
       rapidjson::Document::AllocatorType& alloc:
       rapidjson::Value& jsonValue: json数据
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 保存JSON图谱数据段
     ************************************************/
    bool AEAmpSpectrum::saveJSONSpectrumData(rapidjson::Document::AllocatorType& alloc, rapidjson::Value& jsonValue)
    {
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSignalMax) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax, TEXT_PEAK, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipSignalRMS) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS, TEXT_RMS, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent1) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1, TEXT_FREQUENCY1, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent2) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2, TEXT_FREQUENCY2, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalMax) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax, TEXT_PEAK_BG, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalRMS) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS, TEXT_RMS_BG, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent1) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1, TEXT_FREQUENCY1_BG, alloc, jsonValue);
        if (!m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent2) saveJSONField(m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2, TEXT_FREQUENCY2_BG, alloc, jsonValue);
        return true;
    }

    /************************************************
     * 函数名   : parseBinarySpectrumExtInfo
     * 输入参数 :
       QDataStream& in: 输入流
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析二进制可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::parseBinarySpectrumExtInfo(QDataStream& in)
    {
        if (!in.device()->seek(SPECTRUM_HEADER_LENGTH))
        {
            qDebug() << "AEAmpSpectrum::parseBinarySpectrumExtInfo failed";
            return false;
        }

        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUnit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUnit);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpLowerLimit);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAmpUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUpperLimit);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipAESensorType, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAESensorType);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDataPoint, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDataPoint);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSystemFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSystemFrequency);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipPDTypeProbability, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability, 8, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasPDTypeProbability);

        // 跳过数据部分的字节
        int iBufSize = m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint * perDataSize();
        if (in.status() != QDataStream::Ok ||
            (iBufSize != in.skipRawData(iBufSize)))
        {
            qDebug() << "AEAmpSpectrum::parseBinary skipRawData failed";
            return false;
        }

        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyBand, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyBand);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFrequencyLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyLowerLimit);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipFequencyUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFequencyUpperLimit);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipBGFileName, DataSpecificationGW::TYPE_ASCII, DataSpecificationGW::BG_FILE_NAME_LENTH, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasBGFileName);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipTriggerThreshold, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasTriggerThreshold);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipOpenTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasOpenTime);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipShutTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasShutTime);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipMaxIntervalTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasMaxIntervalTime);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipGain, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasGain);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncSource, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncSource);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncState, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncState);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipSyncFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncFrequency);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bSkipDischargeSeverity, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDischargeSeverity);

        return in.status() == QDataStream::Ok;
    }

    /************************************************
     * 函数名   : parseXMLSpectrumExtInfo
     * 输入参数 :
       XMLDocument& xmlDocumentObj: xml文档对象
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析XML可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::parseXMLSpectrumExtInfo(XMLDocument& xmlDocumentObj)
    {
        xmlDocumentObj.beginElement(spectrumName());
        xmlDocumentObj.beginElement(STR_SPECTRUM_NODE_EXTINFORMATION);

        parseXMLField(xmlDocumentObj, TEXT_AMP_UNIT, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUnit);
        parseXMLField(xmlDocumentObj, TEXT_AMP_MIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpLowerLimit);
        parseXMLField(xmlDocumentObj, TEXT_AMP_MAX, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUpperLimit);
        parseXMLField(xmlDocumentObj, TEXT_SENSOR_TYPE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAESensorType);
        parseXMLField(xmlDocumentObj, TEXT_DATA_POINT, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDataPoint);
        parseXMLField(xmlDocumentObj, TEXT_SYSTEM_FREQUENCY, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSystemFrequency);
        parseXMLField(xmlDocumentObj, TEXT_PD_TYPE_PR, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasPDTypeProbability);
        parseXMLField(xmlDocumentObj, TEXT_BAND_WIDTH, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyBand);
        parseXMLField(xmlDocumentObj, TEXT_FRQ_MIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyLowerLimit);
        parseXMLField(xmlDocumentObj, TEXT_FRQ_MAX, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFequencyUpperLimit);
        parseXMLField(xmlDocumentObj, TEXT_BG_FILE_NAME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasBGFileName);
        parseXMLField(xmlDocumentObj, TEXT_TRIGGER_THRESHOLD, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasTriggerThreshold);
        parseXMLField(xmlDocumentObj, TEXT_OPEN_TIME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasOpenTime);
        parseXMLField(xmlDocumentObj, TEXT_SHUT_TIME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasShutTime);
        parseXMLField(xmlDocumentObj, TEXT_MAX_TIME_INTERVAL, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasMaxIntervalTime);
        parseXMLField(xmlDocumentObj, TEXT_GAIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasGain);
        parseXMLField(xmlDocumentObj, TEXT_SYNC_SOURCE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncSource);
        parseXMLField(xmlDocumentObj, TEXT_SYNC_STATE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncState);
        parseXMLField(xmlDocumentObj, TEXT_SYNC_FREQ, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncFrequency);
        parseXMLField(xmlDocumentObj, TEXT_DISCHARGE_SEVERITY, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDischargeSeverity);

        xmlDocumentObj.endElement();
        xmlDocumentObj.endElement();

        return true;
    }

    /************************************************
     * 函数名   : parseJSONSpectrumExtInfo
     * 输入参数 :
       const rapidjson::Value& jsonValue: json数据
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析JSON可扩展信息段
     ************************************************/
    bool AEAmpSpectrum::parseJSONSpectrumExtInfo(const rapidjson::Value& jsonValue)
    {
        parseJSONField(jsonValue, TEXT_AMP_UNIT, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAmpUnit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUnit);
        parseJSONField(jsonValue, TEXT_AMP_MIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpLowerLimit);
        parseJSONField(jsonValue, TEXT_AMP_MAX, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fAmpUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAmpUpperLimit);
        parseJSONField(jsonValue, TEXT_SENSOR_TYPE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucAESensorType, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasAESensorType);
        parseJSONField(jsonValue, TEXT_DATA_POINT, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.iDataPoint, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDataPoint);
        parseJSONField(jsonValue, TEXT_SYSTEM_FREQUENCY, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSystemFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSystemFrequency);
        parseJSONField(jsonValue, TEXT_PD_TYPE_PR, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.vecPDTypeProbability, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasPDTypeProbability);
        parseJSONField(jsonValue, TEXT_BAND_WIDTH, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucFrequencyBand, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyBand);
        parseJSONField(jsonValue, TEXT_FRQ_MIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFrequencyLowerLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFrequencyLowerLimit);
        parseJSONField(jsonValue, TEXT_FRQ_MAX, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fFequencyUpperLimit, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasFequencyUpperLimit);
        parseJSONField(jsonValue, TEXT_BG_FILE_NAME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.qstrBGFileName, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasBGFileName);
        parseJSONField(jsonValue, TEXT_TRIGGER_THRESHOLD, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fTriggerThreshold, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasTriggerThreshold);
        parseJSONField(jsonValue, TEXT_OPEN_TIME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sOpenTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasOpenTime);
        parseJSONField(jsonValue, TEXT_SHUT_TIME, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sShutTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasShutTime);
        parseJSONField(jsonValue, TEXT_MAX_TIME_INTERVAL, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sMaxIntervalTime, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasMaxIntervalTime);
        parseJSONField(jsonValue, TEXT_GAIN, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.sGain, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasGain);
        parseJSONField(jsonValue, TEXT_SYNC_SOURCE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncSource, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncSource);
        parseJSONField(jsonValue, TEXT_SYNC_STATE, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucSyncState, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncState);
        parseJSONField(jsonValue, TEXT_SYNC_FREQ, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.fSyncFrequency, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasSyncFrequency);
        parseJSONField(jsonValue, TEXT_DISCHARGE_SEVERITY, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.ucDischargeSeverity, m_pAEAmpSpectrumPrivate->m_stAEAmpExtInformationPrivate.bHasDischargeSeverity);

        return true;
    }

    /************************************************
     * 函数名   : parseBinarySpectrumData
     * 输入参数 :
       QDataStream& in: 输入流
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析二进制图谱数据段
     ************************************************/
    bool AEAmpSpectrum::parseBinarySpectrumData(QDataStream& in)
    {
        if (!in.device()->seek(AE_AMP_DATA_START_POS))
        {
            qDebug() << "AEAmpSpectrum::parseBinarySpectrumData failed";
            return false;
        }

        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalMax);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalRMS);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent1);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent2);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalMax);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalRMS);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent1);
        parseBinaryField(in, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bSkipBGFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent2);

        return in.status() == QDataStream::Ok;
    }

    /************************************************
     * 函数名   : parseXMLSpectrumData
     * 输入参数 :
       XMLDocument& xmlDocumentObj: xml文档对象
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析XML图谱数据段
     ************************************************/
    bool AEAmpSpectrum::parseXMLSpectrumData(XMLDocument& xmlDocumentObj)
    {
        xmlDocumentObj.beginElement(spectrumName());
        xmlDocumentObj.beginElement(STR_SPECTRUM_NODE_DATA);

        parseXMLField(xmlDocumentObj, TEXT_PEAK, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalMax);
        parseXMLField(xmlDocumentObj, TEXT_RMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalRMS);
        parseXMLField(xmlDocumentObj, TEXT_FREQUENCY1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent1);
        parseXMLField(xmlDocumentObj, TEXT_FREQUENCY2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent2);
        parseXMLField(xmlDocumentObj, TEXT_PEAK_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalMax);
        parseXMLField(xmlDocumentObj, TEXT_RMS_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalRMS);
        parseXMLField(xmlDocumentObj, TEXT_FREQUENCY1_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent1);
        parseXMLField(xmlDocumentObj, TEXT_FREQUENCY2_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent2);

        xmlDocumentObj.endElement();
        xmlDocumentObj.endElement();

        return true;
    }

    /************************************************
     * 函数名   : parseJSONSpectrumData
     * 输入参数 :
       const rapidjson::Value& jsonValue: json数据
     * 输出参数 : NULL
     * 返回值   : bool
     * 功能     : 解析JSON图谱数据段
     ************************************************/
    bool AEAmpSpectrum::parseJSONSpectrumData(const rapidjson::Value& jsonValue)
    {
        parseJSONField(jsonValue, TEXT_PEAK, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalMax);
        parseJSONField(jsonValue, TEXT_RMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasSignalRMS);
        parseJSONField(jsonValue, TEXT_FREQUENCY1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent1);
        parseJSONField(jsonValue, TEXT_FREQUENCY2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasFrequencyComponent2);
        parseJSONField(jsonValue, TEXT_PEAK_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalMax, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalMax);
        parseJSONField(jsonValue, TEXT_RMS_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGSignalRMS, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGSignalRMS);
        parseJSONField(jsonValue, TEXT_FREQUENCY1_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent1, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent1);
        parseJSONField(jsonValue, TEXT_FREQUENCY2_BG, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.fBGFrequencyComponent2, m_pAEAmpSpectrumPrivate->m_stAEAmpDataPrivate.bHasBGFrequencyComponent2);

        return true;
    }

}
